<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AP费用反馈详情</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">  <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <link href="__STATIC__/layout/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
     <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/demo/webuploader-demo.css">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
</head>

<body style="color:#333;padding:3px;" class="x_sorll">
    <!-- 标题 -->
    <div class="page-heade">
      <h2 class="title_color text-center">AP费用反馈详情</h2>
    </div>
    <form id="f1">
    <!-- 标题 -->
     <table class="table table-bordered text-left bud_hei" style="margin-bottom: 0">
        <tr>
            <td style="min-width: 120px;width: 120px">主题：</td>
            <td class="text-left" colspan="5"><span class=" font-bold">{$apply.title}</span> 活动反馈表</td>
        </tr>
        <tr>
            <td style="min-width: 120px;width: 120px">反馈单号：</td>
            <td style="min-width: 120px;width: 120px">{$fk.no}</td>
            <td style="min-width: 120px;width: 120px">原申请单编号：</td>
            <td style="min-width: 120px;width: 120px"><a href="{:url('apply_de')}?aid={$apply.id}" class="J_menuItem" title="{$apply.no}">{$apply.no}</a></td>
             <td style="min-width: 120px;width: 120px">类型：</td>
             <td>AP费用</td>
        </tr>
         <tr>
            <td style="min-width: 120px;width: 120px">反馈人：</td>
            <td style="min-width: 120px;width: 120px"><a href="javascript:;">{$fk.cname}</a></td>
             <td style="min-width: 120px;width: 120px">所属部门：</td>
             <td colspan="3">{$fk.de_name}</td>
        </tr>
         <tr>
         <td style="min-width: 120px;width: 120px">备注：</td>
             <td colspan="5">{$fk.remark}</td>
        </tr>
 </table>
    <div class="contact-box" style="padding:8px">
       <button class="btn btn-info" type="button" onclick="daochu({$fkid},{$aid})">导出Excel完整版</button>
    </div>
      <table class="table table-bordered text-center bud_hei">
        <tr class="info">
            
            <td>序号</td>
            <td>原明细编号</td>
            <td>供应商编号</td>
            <td>供应商名称</td>
            <td>网店名称</td>
            <td>品牌</td>
            <td>品类</td>
            <td>系列</td>
            <td>活动执行时间</td>
            <td>三级费用科目</td>
            <td>实际投入费用(元)</td>
            <td>预计销量(元)</td>
            <td>预计费用率</td>
            <td>实际销量(元)</td>
            <td>实际费用率</td>
            <td>活动描述</td>
            
        </tr>
        <input type="hidden" name="state" value="" id="state"/>
        <input type="hidden" name="fkid" value="{$fkid}"/>
        {volist name="fkde" id="vo"}
        <tr>
          
           <td>{$i}</td><td>{$apply.no}_{$vo.detail_no}<a href="{:url('mingxijuece')}?did={$vo.id}" title="决策依据" class="J_menuItem" ><span style="display: none;">决策依据</span><span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true" style="display: inline-block;"></span></a></td><td>{$vo.gys_no}</td><td>{$vo.gys_name}</td><td>{$vo.net}</td>
           <td>{$vo.brand}</td><td>{$vo.category}</td><td>{$vo.series}</td> <td>从{$vo.start_time}至{$vo.end_time}</td><td>{$vo.kemu3}</td>
           <td class="num2">{$vo.hanshui}</td><td class="num2">{$vo.zong_xiaoliang}</td><td><span class="num2">{$vo.yujifeiyonglv}</span>%</td><td><input type="hidden" name="did[]" value="{$vo.id}"/><input type="text" name="fankuixiaoliang[]" class="num2i fankuixiaoliang" value="{$vo.fankuixiaoliang}" hs="{$vo.hanshui}"/></td>
           <td><span class="num2 sj">{$vo.shijifeiyonglv}</span>%</td> <td><a onclick="tanchuan({$vo.id})">点击查看</a></td>
        </tr>

        {/volist}
         
        <tr class="trTotal1 font-bold text-right">
            <td colspan="10" class="text-right font-bold">合计</td>
            <td class="text-right num2">{$all.hanshui}</td>
            <td class="text-right num2">{$all.zong_xiaoliang}</td>
            <td class="text-right"></td>
            <td class="text-right num2 allfk">{$all.fankuixiaoliang}</td>
            <td class="text-right"></td>
            <td></td>
        </tr>
        </table>
     <table class="table table-bordered text-left bud_hei">
            <tr class="info">
                <th class="text-left font-bold">审批意见</th>
            </tr>
            {volist name="logs" id="l"}
          <tr>
              <td>{$l.USERNAME} 审批动作：{$l.MEMO}；审批意见：{if $l.COMMENTS}{$l.COMMENTS}{else/}无{/if}(审批时间：{$l.ACTIONTIME})</td>
          </tr>
          
          {/volist}
      </table>
      
   <div class="row text-center no-padding">
   {if $fk.state==2}
                <input type="hidden" id="nodeKey" name="nodeKey"/>
                  <input type="hidden" id="selectId" name="selectId"/>
                  <input type="hidden" id="selectName" name="selectName"/>
                    {volist name="btn.nextNodes" id="b"}
                      {if $b.nodeName=='结束'}
                      <input type="button" class="btn-danger btn" onclick="zuofei('{$b.nodeKey}','{$b.selectId}','{$b.selectName}')" value="点此作废"/>
                      {else/}
                      <input type="button" class="btn-info btn" onclick="baocun('{$b.nodeKey}','{$b.selectId}','{$b.selectName}')" value="保存并提交工作流"/>
                      {/if}
                    {/volist}
   {else/}
      <input type="button" class="btn btn-primary" onclick="tijiao(1)" value="保存为草稿"/>
      <input type="button" class="btn btn-warning" onclick="tijiao(3)" value="保存并提交流程"/>
    {/if}
      <button  class="btn btn-info" type="button" onclick="back()">返回</button>
    
    </div>
    </form>
   <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
   <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
     <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
         <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/layout/js/plugins/summernote/summernote.min.js"></script>
<script src="__STATIC__/layout/js/plugins/summernote/summernote-zh-CN.js"></script>
<script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script>
 <script src="__STATIC__/layout/js/common.js"></script>
  <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
  <script src="__STATIC__/layout/js/contabs_sub.js"></script>
  <script>
  function tijiao(state){
    $("#state").val(state);
     $.ajax({
          cache: true,
          type: "POST",
          url:"{:url('fkxiugai')}",
          data:$('#f1').serialize(),// 你的formid
          async: false,
          error: function(request) {
            alert("Connection error");
          },
          success: function(data) {
            //alert(data);
            //var res=JSON.parse(data);
                    var res1=JSON.parse(data);
                            if(res1["state"]==1){
                              swal({
                                title: "完成",
                                text: "操作已成功",
                                type: "success"
                                },function(){
                                   if(fr==1)
                                        location.href="{:url('aprtright')}"
                                    else
                                        location.href="{:url('Workflowdb/index')}"
                                  //parent.layer.close(parent.layer.getFrameIndex(window.name))
                                  //
                                });

                          }else{
                            swal({
                            title: "错误",
                            text:  res1["msg"],
                            type: "warning"
                            });
                          }        
          }
        });
  }
    var fr={$from};
       function baocun(nodeKey,selectId,selectName){
  $("#nodeKey").val(nodeKey)
  $("#selectId").val(selectId)
  $("#selectName").val(selectName)
   $.ajax({
          cache: true,
          type: "POST",
          url:"{:url('fkbaocunchuli')}",
          data:$('#f1').serialize(),// 你的formid
          async: false,
          error: function(request) {
            alert("Connection error");
          },
          success: function(data) {
            //alert(data);
            //var res=JSON.parse(data);
                    var res1=JSON.parse(data);
                            if(res1["state"]==1){
                              swal({
                                title: "完成",
                                text: "操作已成功",
                                type: "success"
                                },function(){
                                  if(fr==1)
                                        location.href="{:url('aprtright')}"
                                  else
                                        location.href="{:url('Workflowdb/index')}"
                                });

                          }else{
                            swal({
                            title: "错误",
                            text:  res1["msg"],
                            type: "warning"
                            });
                          }           
          }
        });
}
       function zuofei(nodeKey,selectId,selectName){
  $("#nodeKey").val(nodeKey)
  $("#selectId").val(selectId)
  $("#selectName").val(selectName)
   $.ajax({
          cache: true,
          type: "POST",
          url:"{:url('fkzuofeichuli')}",
          data:$('#f1').serialize(),// 你的formid
          async: false,
          error: function(request) {
            alert("Connection error");
          },
          success: function(data) {
           // alert(data);
            //var res=JSON.parse(data);
                    var res1=JSON.parse(data);
                            if(res1["state"]==1){
                              swal({
                                title: "完成",
                                text: "操作已成功",
                                type: "success"
                                },function(){
                                   if(fr==1)
                                        location.href="{:url('aprtright')}"
                                    else
                                        location.href="{:url('Workflowdb/index')}"
                                  //parent.layer.close(parent.layer.getFrameIndex(window.name))
                                  //
                                });

                          }else{
                            swal({
                            title: "错误",
                            text:  res1["msg"],
                            type: "warning"
                            });
                          }         
          }
        });
}
     function back(){
            if(fr==1)
                location.href="{:url('aprtright')}"
            else
                location.href="{:url('Workflowdb/index')}"
        }
  

  function daochu(fkid,aid){
    window.open("{:url('daochufankui')}?fkid="+fkid+"&aid="+aid);
  }
  function jisuan(){
    var zonghe=0;
    $(".fankuixiaoliang").each(function(){
      zonghe+=parseFloat($(this).val());
    })
    $(".allfk").html(zonghe.toFixed(2));
  }
  $(".fankuixiaoliang").blur(function(){
      if(!isNaN(parseFloat($(this).html())))
        var num=parseFloat($(this).html()).toFixed(2);
      else
        var num="0.00";
        $(this).html(num);
    var hs=parseFloat($(this).attr("hs"));
    var xl=parseFloat($(this).val());
    if(xl>0){
      var feilv=hs/xl*100;
      $(this).parent().next().children(0).html(feilv.toFixed(2));
    }else{
      $(this).parent().next().children(0).html("");
    }
    jisuan();
  })
  $(".num2").each(function(){
                if(!isNaN(parseFloat($(this).html())))
                 var num=parseFloat($(this).html()).toFixed(2);
                else
                    var num="0.00";
                $(this).html(num);
            })
  $(".num2i").each(function(){
                if(!isNaN(parseFloat($(this).val())))
                 var num=parseFloat($(this).val()).toFixed(2);
                else
                    var num="0.00";
                $(this).val(num);
            })
     function tanchuan(did){
        $.post("{:url('getdes')}",{did:did},function(re){

            var data=JSON.parse(re);
            if(data["state"]==1){
                 parent.layer.open({
                type: 1,
                skin: 'layui-layer-demo', //样式类名
                closeBtn: false, //不显示关闭按钮
                shift: 2,
                shadeClose: true, //开启遮罩关闭
                content: data["msg"]
                });
            }else{
                   parent.layer.open({
                type: 1,
                skin: 'layui-layer-demo', //样式类名
                closeBtn: false, //不显示关闭按钮
                shift: 2,
                shadeClose: true, //开启遮罩关闭
                content: '系统繁忙请稍后再试'
                });
            }
        })
        
    }

  </script>
</body>

</html>
